package fr.appliClient.server.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "FAMILLE")
public class Family implements AbstractEntity<Long>, Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id_famille")
	private Long id;

	@Column(name = "libelle")
	private String name;

	@Column(name = "description")
	private String description;

	@OneToMany(mappedBy = "family")
	private List<Vehicle> vehicles;

	public Family() {

		vehicles = new ArrayList<Vehicle>();
	}

	public String getName() {

		return name;
	}

	public void setName(String name) {

		this.name = name;
	}

	public String getDescription() {

		return description;
	}

	public void setDescription(String description) {

		this.description = description;
	}

	public List<Vehicle> getVehicles() {

		return vehicles;
	}

	public void setVehicles(List<Vehicle> vehicles) {

		this.vehicles = vehicles;
	}

	public Long getId() {

		return id;
	}

}
